<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<meta charset="utf-8">
<head th:include="@{include} :: header"></head>
<style>
    .layui-form-item{
        margin-bottom: 8px;
    }
</style>
<body>
<div class="layuimini-container">
    <div class="layuimini-main">
        <div class="layui-row">
            <form class="layui-form layui-form-pane" id="signupForm">
                <input id="id" name="id" th:value="${temperatureLimit.id}" type="hidden">
                <input type="hidden" id="groupId" name="groupId" th:value="${groupId}">
                <div class="layui-form-item" th:if="${groupId == null || groupId == undefined}">
                    <label class="layui-form-label">集团：</label>
                    <div class="layui-input-block">
                        <select id="groupId2" name="groupId2" class="layui-input" lay-search="" lay-filter="groupId">
                            <option value="">集团名称</option>
                            <th:block th:each="d : ${groups}">
                                <option th:value="${d.id}" th:text="${d.groupName}" th:selected="${temperatureLimit.groupId eq d.id}"></option>
                            </th:block>
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">类型：</label>
                    <div class="layui-input-block">
                        <select placeholder="--请选择--" name="isRange" id="isRange"
                                class="layui-input chosen-select" lay-filter="isRange" >
                            <option value="0" th:selected="${temperatureLimit.isRange eq 0}">小于等于值</option>
                            <option value="1" th:selected="${temperatureLimit.isRange eq 1}">范围值</option>
                            <option value="2" th:selected="${temperatureLimit.isRange eq 2}">大于等于</option>
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">值：</label>
                    <div class="layui-input-block">
                        <input id="minValue" name="minValue" th:value="${temperatureLimit.minValue}"
                               class="layui-input" type="number">
                    </div>
                </div>
                <div id="maxValueDiv" class="layui-form-item" th:style="'display: ' + ${temperatureLimit.isRange == 1 ? 'block' : 'none'} + ';'">
                    <label class="layui-form-label">最大值：</label>
                    <div class="layui-input-block">
                        <input id="maxValue" name="maxValue" th:value="${temperatureLimit.maxValue}"
                               class="layui-input" type="number">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">状态：</label>
                    <div class="layui-input-block">
                        <select data-placeholder="--请选择--" name="state" id="state"
                                class="layui-input chosen-select">
                            <option value="1" th:selected="${temperatureLimit.state eq 1}">可用</option>
                            <option value="0" th:selected="${temperatureLimit.state eq 0}">禁用</option>
                        </select>
                    </div>
                </div>

                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button type="submit" class="layui-btn layui-btn-normal" lay-submit="" lay-filter="demo1">提交</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript" th:src="@{/js/appjs/module/temperaturelimit/detail.js}"></script>
</body>
</html>
